<!--
	作者：leeeeyx@hotmail.com
	时间：2017-09-27
	描述：菜品销售
-->
<style>
    .btn-primary:focus, .btn-primary.focus {
        color: #fff;
        background-color: #3c8dbc;
        border-color: #367fa9;
    }

    .caret {
        margin-left: 0px !important;
    }
</style>
<style>
    body {
        font-family: "微软雅黑";
    }

    .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
        border: 1px solid #d2d2d2;
    }

    .go {
        width: 50px;
        height: 35px;
        line-height: normal;
        background-color: #ddd;
        border: none;
        color: #000000;
        text-align: center;
        text-decoration: none;
        display: inline-block;
    }

    .page {
        width: 35px;
        height: 35px;
        line-height: normal;
        background-color: #ddd;
        border: none;
        color: #000000;
        text-align: center;
        text-decoration: none;
        display: inline-block;
    }

    .navNum {
        padding: 5px;
        height: 35px;
        line-height: 22px;
    }

    .navbar-nav li {
        padding: 0px 5px 0px 5px;
    }
</style>
<style>
    .print {
        display: none
    }
</style>

<style media="print">
    .print {
        display: block
    }
</style>
<style type="text/css" media="print">
    .noprint {
        display: none;
    }
</style>
<meta charset="UTF-8">
<div class="content-wrapper" style="min-height: 901px;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1 style="text-align:center">
            	加工时长定制记录
        </h1>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header noprint">
                        <div class='col-md-4'>
                            <select class="btn btn-default" style="width: 100%;"
                                    ng-options="w.id as w.name for w in workshops" ng-model="searchId">
                                <option value="" hidden="hidden">全部车间</option>
                            </select>
                        </div>
                        <div class="col-md-4 btn-group col-md-offset-4">
                            <div class="btn-group pull-right">
                                <button class="btn btn-default" ng-click="getWork_time();">查询</button>
                                <button class="btn btn-default" ng-click="generate();">生成数据</button>
                                <!--<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">-->
                                <!--<i class="glyphicon glyphicon-save icon-th"></i>-->
                                <!--<span class="caret"></span>-->
                                <!--</button>-->
                                <!--<ul class="dropdown-menu"-->
                                <!--style="padding: 10px 20px 0px 20px;left: auto;right:0;min-width: 150px;">-->
                                <!--<li style="padding-bottom: 10px;cursor: pointer;"-->
                                <!--ng-click="download('tb_itemsales','菜品销售统计')"><i-->
                                <!--class="glyphicon glyphicon-export icon-th pull-left"></i>&nbsp;导出Excel-->
                                <!--</li>-->
                                <!--<li style="padding-bottom: 10px;cursor: pointer;" ng-click="outPrint()"><i-->
                                <!--class="fa fa-print icon-th pull-left" style="font-size: 16px;"></i>&nbsp;打印-->
                                <!--</li>-->
                                <!--</ul>-->
                            </div>
                        </div>
                    </div>
                    <div class="box-body table-responsive no-padding">
                        <div class="box" style="border: 0px;margin-bottom: 0px;">
                            <div class="box-body no-padding" style="min-height: 407px;">
                                <table class="table table-striped noprint" id="tb_itemPreview">
                                    <thead>
                                    <tr>
                                        <th>品项名称</th>
                                        <th>类型</th>
                                        <th>单位名称</th>
                                        <th>加工时长</th>
                                        <th>定制单位名</th>
                                        <th>转换比率</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <tr ng-repeat="item in items track by $index" style="color:{{item.is_new_added?'red':'black'}}">
                                        <th>{{item.product_name}}</th>
                                        <th>{{item.product_type}}</th>
                                        <th>{{item.manufacturing_unit_name}}</th>
                                        <th>{{item.manufacturing_work_time}}</th>
                                        <th>{{item.calculation_unit_name}}</th>
                                        <th>{{item.calculation_convert_rate}}</th>
                                        <th>
                                        	<a href="" class="btn btn-lg edit" style="padding:0px" title="修改" ng-click="editWork_time(item,$index)"  ><i class="fa fa-edit"  ></i></a>
                  							<a href="" class="btn btn-lg del"  style="padding:0px" title="删除" ng-click="deleteWork_time(item)"><i class="fa  fa-close"></i></a>
                                        </th>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="box-footer noprint">
                                <ul class="nav navbar-nav pull-right">
                                    <li>
                                        	每页
                                        <select name="example1_length" aria-controls="example1" class="input-sm"
                                                ng-change="change(initial)" ng-model="initial"
                                                style="border-radius: 0px;height: 35px;">
                                            <option value="10">10</option>
                                            <option value="25">25</option>
                                            <option value="50">50</option>
                                            <option value="100">100</option>
                                        </select>
                                    </li>
                                    <li>
                                        <input ng-model="page" style="width: 35px;height: 35px;" type="number">
                                        <input type="button" style="" value="跳转" ng-click="selectPage(page)" class="go">
                                    </li>
                                    <li>
                                        <div class="navNum">
                                            {{selPage}}/{{pages}}页
                                        </div>

                                    </li>
                                    <li>
                                        <button type="button" style="" ng-click="Previous()" class="page"><i
                                                class="glyphicon glyphicon-chevron-left"></i></button>
                                    </li>
                                    <li>
                                        <button type="button" style="" ng-click="Next()" class="page"><i
                                                class="glyphicon glyphicon-chevron-right"></i></button>
                                    </li>
                                </ul>
                            </div>

                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- 删除确认 -->
  <div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">提示</h4>
      </div>
      <div class="modal-body form-horizontal">
        <div class="box-body">
           	<h3 style="text-align:center">确认删除{{editData.product_name}}的加工时长定制记录吗？</h3>
        </div>
      </div>
      <div class="modal-footer">
      	<button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-danger btn-lg pull-right" ng-click="confirm('delete')">确定</button>
      </div>
    </div>
  </div>
</div>
<!-- 删除确认 -->
  <div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">修改</h4>
      </div>
      <div class="modal-body form-horizontal">
        <div class="box-body">
           	<div class="form-group">
               <label class="col-sm-6 control-label">加工单位</label>
               <div class="col-sm-6">
                  	<select class="form-control" style="width: 100%;"
                            ng-options="u.id as u.name for u in units" ng-model="staticeditData.manufacturing_unit_id">
                        <option value=""></option>
                    </select>
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-6 control-label">加工时长</label>
               <div class="col-sm-6">
                  <input type="text" class="form-control" placeholder="加工时长" ng-model="staticeditData.manufacturing_work_time" ng-required='true'>
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-6 control-label">计算加工时长的转换单位</label>
               <div class="col-sm-6">
                    <select class="form-control" style="width: 100%;"
                            ng-options="u.id as u.name for u in units" ng-model="staticeditData.calculation_unit_id">
                        <option value=""></option>
                    </select>
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-6 control-label">转换率</label>
               <div class="col-sm-6">
                  <input type="text" class="form-control" placeholder="转换率" ng-model="staticeditData.calculation_convert_rate" ng-required='true'>
               </div>
            </div>
        </div>
      </div>
      <div class="modal-footer">
      	<button type="button" class="btn btn-default btn-lg pull-left" ng-click="cancel()">取消</button>
        <button type="button" class="btn btn-success btn-lg pull-right" ng-click="confirm('edit')">保存</button>
      </div>
    </div>
  </div>
</div>

